package com.baizhi.obj1;

public class SumDemo {
    public static void main(String[] args) {
        System.out.println(add(1,10));
        System.out.println(add(20,50));
    }



    public static int add(int m,int n){
        int sum = 0;
        for (int i = m; i <= n; i++) {
            sum += i;
        }
        return sum;
    }
}
